home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 50
/
Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso
/
Aminet
/
comm
/
irc
/
Babelfish.lha
/
Babelfish2.amirx
< prev
Wrap
Text File
|
2002-05-28
|
2KB
|
65 lines
/* Babelfish translator script for AmIRC ©2002 Michael Trebilcock */
Options Results
Parse Arg Args
INFO Screen
Screen="rt_pubscrname='"Result"'"
IF Exists("LIBS:rexxreqtools.library")|Exists("LIBS/rexxreqtools.library")|Exists("rexxreqtools.library") THEN DO
IF ~SHOW("L","rexxreqtools.library") THEN Call AddLib("rexxreqtools.library",0,-30,0);End
ELSE DO;"ECHO Unable to open rexxreqtools.library, please install LIBS:rexxreqtools.library";Exit;End
IF Args=""|Args="?"|Upper(Args)="HELP" THEN DO
Call cEcho("/rx babelfish2 <Lang> <GUI>")
Call cEcho("/rx babelfish2 <Lang> <Channel/Nickname>")
Call cEcho("/rx babelfish2 <ABORT>")
Call cEcho("")
Call cEcho("Examples:")
Call cEcho("")
Call cEcho("/rx babelfish2 it_en GUI")
Call cEcho("- Will translate anything you type in the window that appears, from italian to english")
Call cEcho("/rx babelfish2 it_en Mick")
Call cEcho("- Will automatically translate any messages from Mick, from italian to english")
Call cEcho("/rx babelfish2 it_en #AmigaZone")
Call cEcho("- Will automatically translate any messages in #AmigaZone, from italian to english")
Call cEcho("/rx babelfish2 ABORT")
Call cEcho("- Will abort ALL automatic translations")
Exit
End
IF Word(Upper(Args),2)="GUI" THEN DO
DO FOREVER
Text=rtgetstring("","Enter text to translate:","Babelfish translator GUI","Ok|Cancel",Screen)
IF rtresult="0" THEN Exit
"SAY /rx babelfish "Word(Args,1) Text
End
End
IF Word(Upper(Args),1)="ABORT" THEN DO
Call SetClip(BabelOn,"0")
Call cEcho("All automatic translation is now off..")
Exit
End
Call cEcho("Automatic translation for "Word(Args,2)" is now on..")
Call SetClip(BabelOn,"1")
DO FOREVER
drop prefix
drop comm
drop dest
drop rest
"GETLINE"
IF GetClip(BabelOn)="0" THEN Exit
prefix=line.prefix
comm=line.command
dest=line.dest
rest=line.rest
Parse Var Prefix Nick"!"User"@"Host
IF Upper(Nick)=Word(Upper(Args),2)|Upper(Dest)=Word(Upper(Args),2) THEN "SAY /rx babelfish \"Word(Args,1)" <"Nick"> "SubStr(Rest,2)
End
cEcho:
"ECHO P="d2c(27)"b«Babelfish» TEXT="Arg(1)
Return 0